<!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
<stack>
<name>in.5__</name>
<id>-1</id>
<cardCount>4</cardCount>
<cardID>2846</cardID>
<listID>2224</listID>
<cantModify><false /></cantModify>
<cantDelete><false /></cantDelete>
<cantAbort><false /></cantAbort>
<cardSize>
<width>512</width>
<height>342</height>
</cardSize>
<script>on printpush cardset lockScreen to truego firstset style of fld "Race" to "Transparent"set style of fld "Class" to "Transparent"set style of fld "Alignment" to "Transparent"set style of fld "Sex" to "Transparent"set style of fld "Lvl" to "Transparent"doMenu Print Stack...set style of fld "Race" to "Shadow"set style of fld "Class" to "Shadow"set style of fld "Alignment" to "Shadow"set style of fld "Sex" to "Shadow"set style of fld "Lvl" to "Shadow"pop cardend printon fileanswer "Open a file or save this sheet ?"¬with "Open" or "Save" or "Cancel"if it is "Cancel" then exit fileelse if it is "Save" thensaveFileelse if it is "Open" thenopenFileend ifend fileon openFileanswer file "What file to open ?" of type textif it is empty then exit openFileput it into fileNameopen file fileNamerepeat with c=1 to the number of cardsgo card crepeat with x=1 to the number of flds - 1 -- save "About" fieldread from file fileName until formFeedput it into fld xdelete last char of fld xend repeatend repeatclose file fileNameend openFileon saveFileanswer file "Name of file:",with fld "Char Name"if it is empty then exit saveFileopen file itrepeat with c=1 to the number of cardsgo card crepeat with x=1 to the number of flds - 1 -- Save "About" fieldwrite fld x & formFeed to file itend repeatend repeatclose file itend saveFileon setLockpush cardAnswer "Unlock or Lock Fields?" with "Unlock" or "Lock" or "Cancel"if it is "Cancel" then exit setLockif it is "Lock" then put true into lockFieldsif it is "Unlock" then put false into lockFieldsgo firstset lockText of fld "Str" to lockFieldsset lockText of fld "Str Mod" to lockFieldsset lockText of fld "Dex" to lockFieldsset lockText of fld "Con" to lockFieldsset lockText of fld "Int" to lockFieldsset lockText of fld "Wis" to lockFieldsset lockText of fld "Chr" to lockFieldsset lockText of fld "Height" to lockFieldsset lockText of fld "Weight" to lockFieldsset lockText of fld "Hit Points" to lockFieldspop cardend setLockon trashAnswer "Erase Everything ?" with "OK" or "Cancel"if it is "Cancel" then exit trashpush cardlock screengo firstrepeat with x=1 to the number of flds - 1 -- save "About" fieldput empty into fld xend repeatgo to card "W/P"click at loc of card fld "Empty"go to card "Inventory"click at loc of card fld "Empty"go to card "A/S"click at loc of card fld "Empty"go to card "XX"pop cardend trashon installButtonanswer "This will install a button in a stack." with "OK" or "Cancel"if it is "Cancel" then exit installButtonpush cardset cursor to 4put "Please wait..."lock screenlock messagesput the long name of this stack into goHeredelete word 1 of gohereput "go to " before gohereput "on mouseup" into first line of buttonScriptput gohere into second line of buttonScriptput "end mouseup" into third line of buttonScriptgo firstshow bg btn "AD&D Character Generator"choose button toolselect bg btn "AD&D Character Generator"doMenu "Copy Button"hide bg btn "AD&D Character Generator"answer file "Choose a stack to place the button in:" of type stackif it is empty then exit installButtongo itdoMenu "Paste Button"unlock screenset cursor to 2put "Just click where you want the button placed."repeat until the mouse is downset the loc of button "AD&D Character Generator" to the mouseLocend repeatset cursor to 4put "Please wait..."set the script of button "AD&D Character Generator" to buttonScriptchoose browse toolpop cardhide msgend installButtonon generateput "STR,DEX,CON,INT,WIS,CHR" into abListpush cardgo firstif the name of bg btn id 100 contains 1 thenrepeat with x=1 to 6put random(6) + random(6) + random(6) into fld item x of abListend repeatelse if the name of bg btn id 100 contains 2 thenrepeat with x=1 to 6put random(6) + random(6) + random(6) into num1put random(6) + random(6) + random(6) into num2put max(num1,num2) into fld item x of abListend repeatelse if the name of bg btn id 100 contains 3 thenshow cd fld "Choose"put empty into cd fld "Choose"repeat for 6put random(6) + random(6) + random(6) & return ¬after cd fld "Choose"end repeatrepeat with x=1 to 6put " Choose a score for:" && item x of abList ¬into line 8-x of cd fld "Choose"wait until the mouseClickput word 2 of the clickLine into lineNumif lineNum ≤ 7-x thenput line lineNum of cd fld "Choose" ¬into fld (item x of abList)delete line lineNum of cd fld "Choose"end ifend repeathide cd fld "Choose"else if the name of bg btn id 100 contains 4 thenshow cd fld "Choose"put empty into cd fld "Choose"repeat for 12put random(6) + random(6) + random(6) & return after cd fld "Choose"end repeatrepeat with x=1 to 6put " Choose a score for:" && item x of abList ¬into line 14-x of cd fld "Choose"wait until the mouseClickput word 2 of the clickLine into lineNumif lineNum ≤ 13-x thenput line lineNum of cd fld "Choose" ¬into fld (item x of abList)delete line lineNum of cd fld "Choose"end ifend repeathide cd fld "Choose"else if the name of bg btn id 100 contains 5 thenshow cd fld "Choose"put empty into cd fld "Choose"repeat for 6put random(6) & "," & random(6) & "," & random (6) & "," & random(6) ¬into listput min(list) into minimput sum(list) - minim into scoreput score & return after cd fld "Choose"end repeatrepeat with x=1 to 6put " Choose a score for:" && item x of abList ¬into line 8-x of cd fld "Choose"wait until the mouseClickput word 2 of the clickLine into lineNumif lineNum ≤ 7-x thenput line lineNum of cd fld "Choose" ¬into fld (item x of abList)delete line lineNum of cd fld "Choose"end ifend repeathide cd fld "Choose"else if the name of bg btn id 100 contains 6 thenput empty into cd fld "Choose"show cd fld "Choose"repeat with x=1 to 6put item x of abList & ":" && 8 & return after cd fld "Choose"end repeatrepeat with x=1 to 7put random(6) & return after cd fld "Choose"end repeatput "Choose a number and an ability." after cd fld "Choose"repeat foreverselect emptyif the number of lines in cd fld "Choose" ≤ 7 then exit repeatwait until the mouseClickput word 2 of the clickLine into lineNumif lineNum ≥ 7 ¬and lineNum ≤ the number of lines in cd fld "Choose" - 1 thenselect line lineNum of cd fld "choose"put line lineNum of cd fld "Choose" into d6else next repeatwait until the mouseClickput word 2 of the clickLine into abLineif abLine ≤ 6 thenif word 2 of line abLine of cd fld "Choose" + d6 > 18then next repeatelseadd d6 to word 2 of line abLine of cd fld "Choose"delete line lineNum of cd fld "Choose"end ifelse next repeatend repeathide cd fld "Choose"repeat with x=1 to 6put word 1 of line x of cd fld "Choose" into titledelete last char of titleput word 2 of line x of cd fld "Choose" into fld titleend repeatend ifpop cardend generateon createMenuif wrongStack() then pass createMenuif there is a menu "PC Generator" then exit createMenucreate menu "PC Generator"put createMenuItems() into menu "PC Generator" with menuMsg createMenuMsgs()end createMenuon uncreateMenuif wrongStack() then pass uncreateMenuif there is not a menu "PC Generator" then exit uncreateMenuelse delete menu "PC Generator"end uncreateMenufunction createMenuItemsif wrongStack() then pass createMenuItemsreturn "About PC Generator..." & return & ¬"-" & return & ¬"Open..." & return & ¬"Save..." & return & ¬"Print..." & return & ¬"-" & return & ¬"Generate" & return & ¬"Lock/Unlock..." & return & ¬"Trash" & return & ¬"-" & return & ¬"Install..."end createMenuItemsfunction createMenuMsgsif wrongStack() then pass createMenuMsgsreturn "show field" & quote & "About" & quote & return & ¬"" & return & ¬"openFile" & return & ¬"saveFile" & return & ¬"print" & return & ¬"" & return & ¬"Generate" & return & ¬"setLock" & return & ¬"trash" & return & ¬"" & return & ¬"installButton"end createMenuMsgsfunction wrongStackget the value of word 2 of the long name of mereturn (it is not line 1 of the stacks)end wrongStackon openStackif wrongStack() then pass openStackcreateMenupalette "AD&DPal","285,290"if the rect of the card window is the screenRect then hide menuBarpass openStackend openStackon closeStackif wrongStack() then pass closeStackif "AD&DPal" is in the windows then close window "AD&DPal"uncreateMenudoMenu "Compact Stack"pass closeStackend closeStackon resumeif wrongStack() then pass resumecreateMenupass resumeend resumeon suspendif wrongStack() then pass suspenduncreateMenupass suspendend suspendon resumeStackif wrongStack() then pass resumeStackcreateMenupass resumeStackend resumeStackon suspendStackif wrongStack() then pass suspendStackuncreateMenupass suspendStackend suspendStackon mouseUphide fld "About"if the number of this card is 1 then hide cd fld "Choose"end mouseUpfunction rnd hi,loput 0 into numput hi mod lo into divisif divis is not 0 thenput hi-lo into rangeput lo-1 into modifierput (the random of range)+modifier into numelseput hi/lo into dicerepeat for loadd the random of dice to numend repeatend ifreturn numend rndon updateTotalsclick at loc of fld "Hit Prob"click at loc of fld "Dam Adj"click at loc of fld "Weight Allow"click at loc of fld "Max Press"click at loc of fld "Open Doors"click at loc of fld "Bend Bars/Lift Gates"click at loc of fld "Reaction Adj"click at loc of fld "Missile Att Adj"click at loc of fld "Defence Adj"click at loc of fld "Hit Point Adj"click at loc of fld "System Shock"click at loc of fld "Resurr Survival"click at loc of fld "Poison Save"click at loc of fld "Regeneration"click at loc of fld "# of Lang"click at loc of fld "Spell Level"click at loc of fld "Chance to Lrn"click at loc of fld "Max # Sp/Lvl"click at loc of fld "Sp Immunity"click at loc of fld "Magic Def Adj"click at loc of fld "Bonus Spells"click at loc of fld "Chance Sp Fail"click at loc of fld "Sp Immunity 2"click at loc of fld "Max# Henchmen"click at loc of fld "Loyalty Base"click at loc of fld "Reaction Adj 2"end updateTotalsfunction sum listput 0 into totalrepeat with x=1 to number of items in listadd item x of list to totalend repeatreturn totalend sum</script>